package com.xiaoxi.yygh.hosp.controller;

import com.xiaoxi.yygh.common.result.Result;
import com.xiaoxi.yygh.hosp.service.HospitalService;
import com.xiaoxi.yygh.model.hosp.Hospital;
import com.xiaoxi.yygh.vo.hosp.HospitalQueryVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/admin/hosp/hospital")
@CrossOrigin
public class HospitalController {
    
    @Autowired
    private HospitalService hospitalService;
    
    // 医院列表(条件查询分页)
    @GetMapping("/list/{page}/{limit}")
    public Result listHosp(@PathVariable Integer page,
                           @PathVariable Integer limit,
                           HospitalQueryVo hospitalQueryVo){
        
        Page<Hospital> pageModel = hospitalService.selectHospPage(page, limit, hospitalQueryVo);
        
        return Result.ok(pageModel);
    }
    
}
